package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestOrder;
import com.estar.assistsurvy.entity.ResponseOrder;
import com.google.gson.Gson;

import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class GrabInfoThread extends BaseThread {

	private RequestOrder requestOrder;

	public GrabInfoThread(Context context, Handler handler, RequestOrder requestOrder) {
		super(context, handler);
		this.requestOrder = requestOrder;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.GRABINFO;
		json=gson.toJson(requestOrder);
		postRequest(url_str, json);
		if(result!=null){
			Log.i("wl", "订单返回参数"+result);
			ResponseOrder responseOrder=new ResponseOrder();
			gson=new Gson();
			responseOrder=gson.fromJson(result, ResponseOrder.class);
			msg.what=0;
			msg.obj=responseOrder;
			msg.sendToTarget();
		}
	}
}
